<?php $this->load->view('backend/header'); ?>

<body class="black">

<?php $this->load->view('backend/top'); ?>
<?php $this->load->view('backend/slidebar'); ?>
	<!-- Style customize -->
	<style>
		#h1_top{
			margin-bottom:10px;
		}
	</style>
	
	<!-- Home page -->
	<input type='hidden' value='render' class='page' />
	
	<!-- CONTENT -->
	<div id="content">
		<h1 id='h1_top'><img src="<?php echo $template_url.'images/' ?>/icons/posts.png" alt="">Edit <?php echo $data['name'] ?></h1>	
		
		<!-- Success notification -->
		<?php if(isset($error) && $error === 0): ?>
		<div class="notif success">
            <strong>Success :</strong>  Upload success
            <a href="#" class="close"></a>
        </div>
        <?php endif; ?>
        
        <!-- Success notification -->
        <?php if(isset($error) && $error !== 0): ?>
		<div class="notif error">
            <strong>Error :</strong>   <?php echo $error ?>
            <a href="#" class="close"></a>
        </div>
        <?php endif; ?>			
		
		<div class="bloc">
			<div class="title"> <?php echo $data['name'] ?> </div>
			<form method='POST' action='' id='form' enctype="multipart/form-data">
			<div class="content">
			
				<!-- Name -->
		        <div class="input">
		            Name:<input type="text" class="range min-10 max-60" value='<?php echo $data['name'] ?>' rel='required' name='name'>
		        </div>	
		        
				<!-- Email -->
		        <div class="input">
		            Email:<input type="text" class="range min-10 max-60" value='<?php echo $data['email'] ?>' rel='' name='email'>
		        </div>			        		
		        		    
				<div class="input textarea">
		            <label for="textarea1"></label>
		            <textarea rel='required' id="wysiwyg" rows="7" cols="4" name='description'><?php echo $data['description'] ?></textarea>
		        </div>		        
				
				<table>
					<tbody>
						<input type='hidden' value='update' name='update' id='update' />

						<!-- Show all image in render -->
						<?php
							 $link_image = $template_url_frontend.'images/upload/'.$data['image_url'];
						?>
						<tr>
							<td class="picture" style="width: 140px;"><a
								href="#" class="zoombox"><img
									src="<?php echo $link_image ?>" alt="" width=80 height=80> </a></td>
									
							<td><a href="#"><?php echo $data['image_url']  ?></a></td>
							
							<td>
								<div class="input">
						            <label for="file">Upload a file</label>
						            <input type="file" name="file" class='upload_file'>
						        </div>
							</td>
						</tr>
						<!-- End show all image in render -->
					</tbody>
				</table>
				<div class="submit" style='text-align: center; margin-top:10px;'>
				    <input type="submit" value="Save new" class="button black" id='update' name='update'>
				</div>	
				<input type='hidden' name='num_file' id='num_file' value='1' />
				</form>
			</div>
		</div>
	</div>
</body>
</html>
